#!/bin/bash

SIZE="128 512 1024 8192"
NODES="1 16 24"
HOSTS="creek01,creek01,creek02,creek02,creek03,creek03,creek04,creek04,creek05,creek05,creek07,creek07,creek08,creek08"
ITER=100
DELTAT=5000
OUTPUT="./simul/output_simulation"


if [ -f nbody ]
then
	echo "<--CLEAR-->"
	rm nbody
fi

make all

for i in $NODES
do
	echo "NODES " $i
	for j in $SIZE
	do
		echo "SIZE " $j " max SIZE 16384"
		echo "# start " $(date) | tee $OUTPUT$i"_"$j".dat"
		mpirun -host $HOSTS -np $i ./nbody $j $ITER $DELTAT >> $OUTPUT$i"_"$j".dat"
		echo "# end " $(date) | tee -a $OUTPUT$i"_"$j".dat"
	done

done
